use time::OffsetDateTime;
// use mongodb::bson::{
// doc,
// serde_helpers::{chrono_datetime_as_bson_datetime, uuid_as_binary},
// };
// use sea_orm::entity::prelude::*;
use sqlx::FromRow;
use serde::{Deserialize, Serialize};

use uuid::Uuid;

use super::Model;
#[derive(Serialize, Deserialize, Debug, FromRow)]
pub struct Post{
    id: Uuid,
    title: Option<String>,
    word_count: Option<i64>,
    real_url: String,
    alternative_url: Option<String>,
    // #[serde(with = "chrono_datetime_as_bson_datetime")]
    created: OffsetDateTime,
}

impl Post{
    pub fn new( id: Uuid, title: Option<String>, word_count: Option<i64>, real_url: String, alternative_url: Option<String>, created: OffsetDateTime) -> Self {
Self { id, title, word_count, real_url, alternative_url, created }
    }
    pub fn id(&self) -> Uuid {
        self.id
    }
    pub fn title(&self) -> Option<String> {
        self.title.clone()
    }
    pub fn word_count(&self) -> Option<i64> {
        self.word_count
    }
    pub fn real_url(&self) -> &str {
        &self.real_url
    }
    pub fn alternative_url(&self) -> Option<String> {
        self.alternative_url.clone()
    }
    pub fn created(&self) -> OffsetDateTime {
        self.created
    }
}
// impl Model for Post {}

// #[derive(Copy, Clone, Debug)]
// pub enum Relation {
// }
// impl ActiveModelBehavior for ActiveModel {}
